// GummyBear ^_^
// command.h

#include <string>

#include "titleNode.h"
#include "table.h"

#pragma once

extern std::string curDB;

class command {
//--------------------Mem-var------------------
private:

public:
  // keyWords: CREATE DROP USE INSERT SELECT DELETE EXIT
  std::string keyWord;

  // object: DATABASE, TABLE
  std::string obj;

  // objName
  std::string objName;

  // For example, the command: 'CREATE TABLE Gummy'
  // keyWords is 'CREATE', object is 'TABLE', objname is 'Gummy'.

  // titlePtrNode
  titleNode* titleHead;
  
  // InsertValue
  std::string insertValue;

  //Todo


//-------------------Mem-func-------------------
private:

  // Control the database;
  bool _create();
  bool _drop();
  bool _use();

  // Control the table;
  bool _createTable();
  bool _droptable();
  bool _insert();
  bool _select();
  bool _delete();

  // Error;
  void _error();

  // Destory;
  void _Destory();
public:
  // Instructor with a keyword;
  command(std::string key);

  // Excecute this command;
  bool excecute();
};